/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2008, 2009, 2010.

	This file is part of the Maxsi Library.

	Maxsi Library is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Library is distributed in the hope that it will be useful, but
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
	or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
	License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Library. If not, see <http://www.gnu.org/licenses/>.

	Maxsi Library
	A powerful Cross-Platform C++ General Purpose Library that allows you to
	efficiently create high-performance and reliable applications.

	MaxsiLibraryLink.h
	Macros and systems to make it easier to link to the Maxsi Library.

******************************************************************************/

#ifndef MaxsiLibraryLink_H
#define MaxsiLibraryLink_H

BeginMaxsiNamespace

//=============================================================================
//	Ensure we use the correct import/export syntax for the right platforms.
//=============================================================================
#ifdef _WIN32
	#define MAXSI_DLL_IMPORT_DECL __declspec( dllimport )
	#define MAXSI_DLL_EXPORT_DECL __declspec( dllexport )

	#define MAXSI_CALL __stdcall
#else
	#if __GNUC__ >= 4
		#define MAXSI_DLL_IMPORT_DECL __attribute__ ((visibility("default")))
		#define MAXSI_DLL_EXPORT_DECL __attribute__ ((visibility("default")))
	#else
		#define MAXSI_DLL_IMPORT_DECL
		#define MAXSI_DLL_EXPORT_DECL
	#endif

	#define MAXSI_CALL
#endif

//=============================================================================
//	Define import/export Macros
//=============================================================================
#define MAXSI_DLL_IMPORT extern "C" MAXSI_DLL_IMPORT_DECL
#define MAXSI_DLL_EXPORT extern "C" MAXSI_DLL_EXPORT_DECL
#define MAXSI_DLL_IMPORT_C extern "C" MAXSI_DLL_IMPORT_DECL
#define MAXSI_DLL_EXPORT_C extern "C" MAXSI_DLL_EXPORT_DECL
#define MAXSI_DLL_IMPORT_CPP extern MAXSI_DLL_IMPORT_DECL
#define MAXSI_DLL_EXPORT_CPP extern MAXSI_DLL_EXPORT_DECL

//=============================================================================
//	Define macros so that projects will link against Maxsi Library correctly.
//=============================================================================
#ifdef Maxsi_Library
	//=============================================================================
	//	The following values are used within Maxsi Library.
	//=============================================================================
	#define MAXSI_LINK MAXSI_DLL_EXPORT
	#define MAXSI_LINKCPP MAXSI_DLL_EXPORT_CPP
	#define MAXSI_CLASSLINK extern "C" class MAXSI_DLL_EXPORT_DECL
	#define MAXSI_CLASSLINKCPP extern "C++" class MAXSI_DLL_EXPORT_DECL
	#define MAXSI_STRUCTLINK extern "C" struct MAXSI_DLL_EXPORT_DECL
	#define MAXSI_STRUCTLINKCPP extern "C++" struct MAXSI_DLL_EXPORT_DECL
#elif defined(Maxsi_Library_Custom_Implementation)
	//=============================================================================
	//	The following values are used within projects that use MaxsiLibrary
	//	code within itself without linking to Maxsi Library.
	//=============================================================================
	#define MAXSI_LINK MAXSI_DLL_EXPORT
	#define MAXSI_LINKCPP MAXSI_DLL_EXPORT_CPP
	#define MAXSI_CLASSLINK class
	#define MAXSI_CLASSLINKCPP class
	#define MAXSI_STRUCTLINK struct
	#define MAXSI_STRUCTLINKCPP struct
#else
	//=============================================================================
	//	The following values are used within a normal project that dynamically
	//	links to Maxsi Library.
	//=============================================================================
	#define MAXSI_LINK MAXSI_DLL_IMPORT
	#define MAXSI_LINKCPP MAXSI_DLL_IMPORT_CPP
	#define MAXSI_CLASSLINK extern "C" class MAXSI_DLL_IMPORT_DECL
	#define MAXSI_CLASSLINKCPP extern "C++" class MAXSI_DLL_IMPORT_DECL
	#define MAXSI_STRUCTLINK extern "C" struct MAXSI_DLL_IMPORT_DECL
	#define MAXSI_STRUCTLINKCPP extern "C++" struct MAXSI_DLL_IMPORT_DECL
#endif

EndMaxsiNamespace

#endif
